package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.service.CheckItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("checkitem")
@Api(tags = "传智健康预约模块之检查项管理")
public class CheckItemController {

    @Reference
    private CheckItemService checkItemService;

    @GetMapping("findAll")
    @ApiOperation(value = "查询功能",notes = "检查项查询列表信息")
    public Result   findAll(){
        return  new Result(checkItemService.list());
    }
    @DeleteMapping("delete/{id}")
    @ApiOperation(value = "删除功能",notes = "根据id 删除指定检查项")
    public Result   delete(@PathVariable("id") int id){
        return  new Result(checkItemService.removeById(id));
    }

}
